using System;
using System.Collections.Generic;

using SMSSender.Entities.Utils;
using SMSSender.Entities.Models;
using SMSSender.DAL;
using SMSSender.Common;

namespace SMSSender.Biz
{
	public class CustomerHistoryService
	{
		/// <summary>
		/// Saves a record to the CustomerHistory table.
		/// </summary>
		public virtual void Insert(CustomerHistoryInfo customerHistoryInfo)
		{
			try
			{
				new CustomerHistoryDAO().Insert(customerHistoryInfo);
			}
			catch (Exception ex)
			{
				Logger.Error("SMSSender.Biz.CustomerHistory - Insert", ex);
				throw;
			}

		}

		/// <summary>
		/// Saves a record to the CustomerHistory table.
		/// </summary>
		public virtual void Update(CustomerHistoryInfo customerHistoryInfo)
		{
			try
			{
				new CustomerHistoryDAO().Update(customerHistoryInfo);
			}
			catch (Exception ex)
			{
				Logger.Error("SMSSender.Biz.CustomerHistory - Update", ex);
				throw;
			}

		}

		/// <summary>
		/// Delete a record from the CustomerHistory table.
		/// </summary>
		public virtual void Delete(Guid? idAo)
		{
			try
			{
				new CustomerHistoryDAO().Delete(idAo);
			}
			catch (Exception ex)
			{
				Logger.Error("SMSSender.Biz.CustomerHistory - Delete", ex);
				throw;
			}

		}

		/// <summary>
		/// Selects a single record from the CustomerHistory table.
		/// </summary>
		public virtual CustomerHistoryInfo Select(Guid? idAo)
		{
			try
			{
				return new CustomerHistoryDAO().Select(idAo);
			}
			catch (Exception ex)
			{
				Logger.Error("SMSSender.Biz.CustomerHistory - Select", ex);
				throw;
			}

		}

		/// <summary>
		/// Selects all records from the CustomerHistory table.
		/// </summary>
		public List<CustomerHistoryInfo> SelectAll()
		{
			try
			{
				return new CustomerHistoryDAO().SelectAll();
			}
			catch (Exception ex)
			{
				Logger.Error("SMSSender.Biz.CustomerHistory - SelectAll", ex);
				throw;
			}

		}

	}
}
